from rest_framework.serializers import ModelSerializer
from course import models





class CateSer(ModelSerializer):
    class Meta:
        model=models.CateModel
        fields=["id","name"]

class CateSonSer(ModelSerializer):

    son=CateSer(many=True)
    class Meta:
        model=models.CateModel
        fields=["id","name","son"]


class TeacherSer(ModelSerializer):

    class Meta:
        model=models.TeacherModel
        fields="__all__"


class CourseSer(ModelSerializer):
    teacher=TeacherSer()
    class Meta:
        model=models.CourseModel
        fields="__all__"






